//
//  WBStatusCell.swift
//  czWB
//
//  Created by Qing on 2019/1/16.
//  Copyright © 2019年 成哥哥. All rights reserved.
//

import UIKit

class WBStatusCell: UITableViewCell {

    /// 单条微博视图模型
    var StatusViewModel: WBStatusViewModel? {
        
        didSet {
//            设置微博昵称
//            设置微博正文
//            设置微博来源
//            设置VIP icon
//            设置认证图标
//            设置用户头像-优化图片性能
//            给底部工具栏传值
            nameLabel.text = StatusViewModel?.status.user?.screen_name
            contentLabel?.text = StatusViewModel?.status.text
            sourceLable.text = StatusViewModel?.status.source
            vipIconView.image = StatusViewModel?.vipIconView
            verifiedTypeIcon.image = StatusViewModel?.verifiedTypeIcon
            avatarIconView.cz_setImage(urlSting: StatusViewModel?.status.user?.profile_image_url ?? "",
                                       placeholderImage: UIImage(named: "welComen_image_pro"),isAvatar:  true)
            
            buttonToolBar.ViewModel = StatusViewModel
        }
        
    }
    
    /// 用户头像
    @IBOutlet weak var avatarIconView: UIImageView!
    
    /// 用户昵称
    @IBOutlet weak var nameLabel: UILabel!
    
    /// 昵称旁边的VIP标识icon
    @IBOutlet weak var vipIconView: UIImageView!
    
    /// 发布时间
    @IBOutlet weak var timeLabel: UILabel!
    
    /// 发布来源
    @IBOutlet weak var sourceLable: UILabel!
    
    /// 头像右下角的认证标识
    @IBOutlet weak var verifiedTypeIcon: UIImageView!
    
    /// 正文
    @IBOutlet weak var contentLabel: UILabel!
    
    /// 底部工具栏
    @IBOutlet weak var buttonToolBar: WBStatusToolBar!
    
    /// 配图视图
    @IBOutlet weak var pictureView: UIView!
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
